import { mysqlParser } from '../sql-parser';


/* eslint-disable no-restricted-globals */
const childThread = () => {
	// e// self代表子线程自身，即子线程的全局对象
	const ctx: Worker = self as any;

	ctx.onmessage = (event) => {
    if(event.data&&event.data.text){
		ctx.postMessage(mysqlParser(event.data.text, event.data.index));
    }

	};
  return ctx;
}

export default childThread;
